package com.song.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.jws.WebParam;

/**
 * @ClassName : JspController
 * @Author : 司猫子
 * @Date: 2021/3/1 8:32
 */
@Controller
public class JspController {
    @RequestMapping("/tojsp")
    public ModelAndView toJsp(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("date","djjdjdjdjdd");
        modelAndView.setViewName("index");
        return modelAndView;
    }

    @RequestMapping("/hehe")
    @ResponseBody
    public String hello(){
        return "hehehehehehe";
    }
    @RequestMapping("/toto")
    public String toto(Model model){
        model.addAttribute("date", "oooooooo");
        return "index";
    }
}
